package com.ruoyi.pidaijiData.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.pidaijiData.domain.plat.DataPidaijiChengzhong;
import com.ruoyi.pidaijiData.mapper.DataPidaijiChengzhongMapper;
import com.ruoyi.pidaijiData.service.IDataPidaijiChengzhongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;


/**
 * 皮带机称重测试数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-04
 */
@Service
public class DataPidaijiChengzhongServiceImpl implements IDataPidaijiChengzhongService
{
    @Autowired
    private DataPidaijiChengzhongMapper dataPidaijiChengzhongMapper;

    /**
     * 查询皮带机称重测试数据
     * 
     * @param czId 皮带机称重测试数据主键
     * @return 皮带机称重测试数据
     */
    @Override
    public DataPidaijiChengzhong selectDataPidaijiChengzhongByCzId(Long czId)
    {
        return dataPidaijiChengzhongMapper.selectDataPidaijiChengzhongByCzId(czId);
    }

    /**
     * 查询皮带机称重测试数据列表
     * 
     * @param dataPidaijiChengzhong 皮带机称重测试数据
     * @return 皮带机称重测试数据
     */
    @Override
    public List<DataPidaijiChengzhong> selectDataPidaijiChengzhongList(DataPidaijiChengzhong dataPidaijiChengzhong)
    {
        return dataPidaijiChengzhongMapper.selectDataPidaijiChengzhongList(dataPidaijiChengzhong);
    }

    /**
     * 查询皮带机称重测试数据
     *
     * @param dataTaskId
     * @return 皮带机称重测试数据
     */
    @Override
    @Async("threadPoolKy")
    public Future<List<DataPidaijiChengzhong>> selectDataPidaijiChengzhongByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataPidaijiChengzhongMapper.selectDataPidaijiChengzhongByDataTaskId(dataTaskId));
    }

    /**
     * 新增皮带机称重测试数据
     *
     * @param dataPidaijiChengzhongs 皮带机称重测试数据
     * @return 结果
     */
    @Override
    public int batchDataPidaijiChengzhong(List<DataPidaijiChengzhong> dataPidaijiChengzhongs) {
        return dataPidaijiChengzhongMapper.batchDataPidaijiChengzhong(dataPidaijiChengzhongs);
    }

    /**
     * 修改皮带机称重测试数据
     *
     * @param dataTaskId
     * @return 结果
     */
    @Override
    public int updateDataPidaijiChengzhongByDataTaskId(Long dataTaskId) {
        return dataPidaijiChengzhongMapper.updateDataPidaijiChengzhongByDataTaskId(dataTaskId);
    }

    /**
     * 修改皮带机称重测试数据
     *
     * @param czId
     * @return 结果
     */
    @Override
    public int updateDataPidaijiChengzhongByCzId(Long czId) {
        return dataPidaijiChengzhongMapper.updateDataPidaijiChengzhongByCzId(czId);
    }

    /**
     * 新增皮带机称重测试数据
     * 
     * @param dataPidaijiChengzhong 皮带机称重测试数据
     * @return 结果
     */
    @Override
    public int insertDataPidaijiChengzhong(DataPidaijiChengzhong dataPidaijiChengzhong)
    {
        dataPidaijiChengzhong.setCreateTime(DateUtils.getNowDate());
        return dataPidaijiChengzhongMapper.insertDataPidaijiChengzhong(dataPidaijiChengzhong);
    }

    /**
     * 修改皮带机称重测试数据
     * 
     * @param dataPidaijiChengzhong 皮带机称重测试数据
     * @return 结果
     */
    @Override
    public int updateDataPidaijiChengzhong(DataPidaijiChengzhong dataPidaijiChengzhong)
    {
        dataPidaijiChengzhong.setUpdateTime(DateUtils.getNowDate());
        return dataPidaijiChengzhongMapper.updateDataPidaijiChengzhong(dataPidaijiChengzhong);
    }

    /**
     * 批量删除皮带机称重测试数据
     * 
     * @param czIds 需要删除的皮带机称重测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataPidaijiChengzhongByCzIds(Long[] czIds)
    {
        return dataPidaijiChengzhongMapper.deleteDataPidaijiChengzhongByCzIds(czIds);
    }

    /**
     * 删除皮带机称重测试数据信息
     * 
     * @param czId 皮带机称重测试数据主键
     * @return 结果
     */
    @Override
    public int deleteDataPidaijiChengzhongByCzId(Long czId)
    {
        return dataPidaijiChengzhongMapper.deleteDataPidaijiChengzhongByCzId(czId);
    }
}
